/*
 * Image.h
 *
 *  Created on: 23.02.2011
 *      Author: Markus
 */

#ifndef BADAIMAGE_H_
#define BADAIMAGE_H_

#include <vector>
#include <FGraphics.h>
#include <FBase.h>
#include "Opennav.h"

class BadaImage : public opennav::CanvasInterface {
public:
	BadaImage();
	~BadaImage();
	result Construct(Osp::Graphics::Canvas* canvas);

	Osp::Graphics::Canvas* GetCanvas();

public:
	void set_foreground_color(opennav::Color& color);
	void set_background_color(opennav::Color& color);
	void set_line_width(int32_t width);
	void set_font(const opennav::Font& font);
	void draw_lines(const std::vector<opennav::Point>& polyline);
	void draw_line(const opennav::Point& a, const opennav::Point& b);
	void draw_polygon(const std::vector<opennav::Point>& polygon);
	void draw_rectangle(const opennav::Point& point, int32_t width, int32_t height);
	void draw_circle(const opennav::Point& center, int32_t radius);
	void draw_text(const opennav::Point& point, const std::string& text);
	void draw_text_tilted(const opennav::Point& center, const std::string&text, int dx, int dy);
	void get_text_dimension(const std::string& text, opennav::Dimension& dimension);

	int32_t width();
	int32_t height();

private:
	Osp::Graphics::Font* GetFont();

	Osp::Graphics::Canvas* __pCanvas;
	int __width, __height;
	Osp::Graphics::Color __foreground;
	Osp::Graphics::Color __background;
	Osp::Graphics::Font* __pFont;
};

#endif /* BADAIMAGE_H_ */
